package org.bookshare.validator.rule;

import java.io.IOException;

import org.benetech.event.EventListener;
import org.bookshare.validator.report.ValidationMetadata;

/**
 * Rule that defines a test for a given set of validation requirements.
 * @author Reuben Firmin
 */
public interface Rule {

    /**
     * Evaluate the supplied resources to see if they validate against the
     * requirements specified by this rule. Rules implementations should
     * insert violations into the reportMetadata.
     * @param validationMetadata report metadata, already populated with the
     * documentset; the list of rule implementations should fill in properties
     * as they go
     * @param listener User feedback object.
     * @throws IOException If file access fails.
     */
    void evaluate(ValidationMetadata validationMetadata, EventListener listener)
        throws IOException;
}
